import request from '@/utils/request'
// 获取列表
export function getProperties(params) {
  return request({
    url: '/properties',
    method: 'get',
    params
  })
}
// 新增
export function setProperties(data) {
  return request({
    url: '/properties',
    method: 'post',
    data
  })
}
// 获取总数
export function getPropertiesCount(params) {
  return request({
    url: '/properties/count',
    method: 'get',
    params
  })
}
// 获取指定id详情
export function getProperty(id) {
  return request({
    url: `/properties/${id}`,
    method: 'get'
  })
}

// 修改指定id数据
export function editProperty(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}

// 删除指定id数据
export function delProperty(id) {
  return request({
    url: `/properties/${id}`,
    method: 'delete'
  })
}

// 获取高德地图地址数据
export function getAddressData() {
  return request({
    method: 'get',
    url: 'https://restapi.amap.com/v3/config/district?parameters',
    params: {
      key: '767dfa213e19c4361f089409de249960',
      subdistrict: 3
    },
    noToken: true
  })
}
